projects
/
gtk4.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f10c0da
)
gtkfilesystem: protect against null filesystem type
author
Carlos Soriano
<csoriano@gnome.org>
Wed, 7 Oct 2015 23:19:19 +0000
(
01:19
+0200)
committer
Carlos Soriano
<csoriano@gnome.org>
Wed, 7 Oct 2015 23:21:28 +0000
(
01:21
+0200)
The filesystem:type attribute could be NULL, then g_strv_contains
will crash if that happens.
Just don't call it if the attribute is not set.
gtk/gtkfilesystem.c
patch
|
blob
|
history
diff --git
a/gtk/gtkfilesystem.c
b/gtk/gtkfilesystem.c
index 09601bd261788e3ea9693a31ea3fee6caa0c5f05..a26619443b1b3aa8027e14052030ff857ea48ad9 100644
(file)
--- a/
gtk/gtkfilesystem.c
+++ b/
gtk/gtkfilesystem.c
@@
-947,7
+947,10
@@
_gtk_file_consider_as_remote (GFile *file)
const gchar *type;
type = g_file_info_get_attribute_string (info, "filesystem::type");
- is_remote = g_strv_contains (remote_types, type);
+ if (type != NULL)
+ is_remote = g_strv_contains (remote_types, type);
+ else
+ is_remote = FALSE;
g_object_unref (info);
}